import {RequestUtil} from '@/utils'

/**
 * 系统服务所有的Ajax 请求封装
 *
 * */

export class AccountApi {

 

    // 读取验证码 Base64
    static getCaptcha = (uuid: string) => RequestUtil.getAjax(`/manager/access/open/captcha/${uuid}`,)


    // 账号密码登录
    static login = (data: Record<string, any>) => RequestUtil.postAjax(`/manager/access/open/accountLogin`, data)



    // 注销登录
    static logout = () => RequestUtil.postAjax(`/manager/access/account/logout`)




    // 获取账号信息
    static getSimpleInfo = () => RequestUtil.postAjax(`/manager/access/account/getSimpleInfo`)

    // 获取账号ACL资料
    static getAclMeta = () => RequestUtil.postAjax(`/manager/access/account/getAclMeta`)
    //= =========================





    //  加载账号密保问题
    static loadSecretQss = (data: Record<string, any>) => RequestUtil.postAjax(`/manager/access/login/loadSecretQss`, data)


    // 执行密码找回
    static findPsw = (data: Record<string, any>) => RequestUtil.postAjax(`/manager/access/login/findPsw`, data)





    // 修改账户基础资料
    static changeAccountInfo = (data: Record<string, any>) => RequestUtil.postAjax(`/manager/access/account/changeAccountInfo`, data)


    // 获取操作员账号信息
    static changePsw = (data: Record<string, any>) => RequestUtil.putAjax(`/manager/access/account/changePsw`, data)


    // 检验密码是否正确
    static checkPsw = (data: Record<string, any>) => RequestUtil.postAjax(`/manager/access/account/checkPsw`, data)


    // 获取密保问题列表
    static getQuestionList = () => RequestUtil.getAjax(`/smart-system/resource/dict/secret-question`)

    // 保存密保问题
    static saveSecretQuestion = (data: Record<string, any>) => RequestUtil.postAjax(`/manager/access/account/saveSecretQuestion`, data)

    // 加载应用信息
    static findServiceList = (data: Record<string, any>) => RequestUtil.postAjax(`/smart-system/resource/findServiceList`, data)


    // 查询账号登录日志
    static getLoginLogo = (data: Record<string, any>) => RequestUtil.getAjax(`/smart-logs/mine/loginLog/pageList`, data)


    // 查询相关软件下载列表
    static getSoftList = () => RequestUtil.getAjax(`/smart-system/dashboard/softList`)

    // 查看新闻
    static getNewsList = (data: Record<string, any>) => RequestUtil.getAjax(`/smart-info/mine/lastNewsList`, data)


    // 查看新闻
    static getNoticeList = (data: Record<string, any>) => RequestUtil.getAjax(`/smart-info/mine/lastNoticeList`, data)


    static getOfficeCarDynamic = () => RequestUtil.getAjax(`/smart-parking/dashboard/getOfficeCarDynamic`)
}
